export const getYearOption = function(pre=9, next=0) {
    let res = []
    let curYear = (new Date()).getFullYear()

    for(let i = curYear + next; i >= curYear - pre; i--) {
        res.push({
            label: i + '年',
            value: i
        })
    }
    return res
}

export const getMonthOption = function() {
    let res = []

    for(let i = 1; i <= 12; i++) {
        res.push({
            label: i + '月',
            value: i < 10 ? `0${i}` : `${i}`
        })
    }
    return res
}

export const getCurDate = function() {
    let curDate = new Date()
    let month = curDate.getMonth() + 1

    return {
        year: curDate.getFullYear(),
        month: curDate.getMonth() + 1,
        month: month < 10 ? `0${month}` : `${month}`,
        date: curDate.getDate(),
    }
}